
from pages.basePage3 import BasePage
from config.setting import host_port
class OrderManage(BasePage):
    def __init__(self):
        BasePage.__init__(self)

        self.driver.get(f"http://{host_port}/SharedParkingPlace/property/index.html")
    # 定位层
    # 定位订单管理
    def elment_dingdanguanli(self):
        return self.driver.find_element_by_xpath('//div[@id="main"]/div[1]/div[1]/div[1]/div[1]')
    # 定位查看订单
    def elment_chakan(self):
        return self.driver.find_element_by_xpath('//div[@id="_easyui_tree_1"]/span[3]')
    # 定位表单
    def elment_biaodan(self):
        a=self.driver.find_element_by_xpath('//div[@id="testIframe"]/div[2]/div[2]/div/iframe')
        return a
    # 定位文本框
    def elment_yemian(self):
        return self.driver.find_element_by_xpath('/html[@class="panel-fit"]/body/div/div[1]')
class See(OrderManage):
    # 操作层
    def __init__(self):
        OrderManage.__init__(self)
    # 点击订单管理
    def click_dingdanguanli(self):
        self.elment_dingdanguanli().click()
    #     点击查看订单
    def click_chakan(self):
        self.elment_chakan().click()
    # 切换表单
    def get_biaodan(self):
        c=self.elment_biaodan()
        return self.driver.switch_to.frame(c)
    # 获取文本框内容
    def text_yemian(self):
        return self.elment_yemian().text
class See1(See):
    # 应用层
    def __init__(self):
        See.__init__(self)
    def order1(self):
        self.click_dingdanguanli()
        self.click_chakan()
        self.get_biaodan()
        b=self.text_yemian()


        return b
if __name__ == '__main__':
    See1().order1()